﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class NewsDetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string sid = Request.QueryString["id"];
        int id = 0;
        try
        {
            id = Convert.ToInt32(sid);
        }
        catch
        {
            Response.Write("非法的参数");
            Response.End();
        }
        BZZ.DataAcess woker = new BZZ.DataAcess();
        string sql = "select * from news where id=" + id.ToString();
        DataSet dset = woker.Execute(sql);
        if (dset.Tables[0].Rows.Count > 0)
        {
            DataRow row = dset.Tables[0].Rows[0];
            string title = row["title"].ToString();
            string content = row["content"].ToString();
            string pubdate = row["pubdate"].ToString();
            lblDate.Text = Convert.ToDateTime(pubdate).ToString("yyyy-MM-dd");
            litContent.Text = content;
            litTitle.Text = title;
            metaTitle1.Text = title + " - 新闻中心";
        }
    }
}
